<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/taglibs/iss" prefix="iss"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>选择角色</TITLE>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="../css/IDEA.css" type=text/css rel=stylesheet>
<SCRIPT language=javascript src="../js/IDEA_body.js"
	type=text/javascript></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" type=text/javascript>      
     function allCheckBox(obj)
     {
        var flag =  document.getElementsByName("checkbox2"); 
            
        if(obj.checked == true)
        {       
          for(var i = 0; i < flag.length; i++)
          { 
             flag[i].checked = true;
             var str =  flag[i].value.split(",");
             window.parent.saveValue(str[0],str[1]);
          }
        }
        else
        {
          for(var i = 0; i < flag.length; i++)
          {
             flag[i].checked = false;
             var str =  flag[i].value.split(",");
             window.parent.delValue(str[0],str[1]);
          }
        }              
     }
     
     function cancelMyBox(obj)
     {
        var box =  document.getElementsByName("checkbox2");
        var mybox =  document.getElementsByName("mybox");        
        var flag = true;
      
        for(var i = 0; i < box.length; i++)
        {
            if(!box[i].checked)
            {
               flag = false;
            }          
        }
        if(obj.checked == true)
        {
           var str = obj.value.split(",");
                           
           window.parent.saveValue(str[0],str[1]);
           
        }
        else
        {
             var str = obj.value.split(",");
             
             window.parent.delValue(str[0],str[1]);       
        }
        if(flag)
        {
           mybox[0].checked=true;
        }
        else
        {
           mybox[0].checked=false;
        }
     
     } 
  
  function chooseRole()
  {
     
	closeWin();
	
	return;
  } 
   
  function closeWin()  
  {
	  window.parent.ymPrompt.close();
	  
      return;  
  }
  
  function init()
  {
    var flag = true;
    var box =  document.getElementsByName("checkbox2");   
    var mybox =  document.getElementsByName("mybox"); 
    var strId = window.parent.strId;            
    if(null != strId && 0 != strId.length)
    {
       for(var i = 0; i < strId.length; i++)
       {
           for(var j = 0; j < box.length; j++)
           {
               var str = box[j].value.split(",");
               if(strId[i] == str[0])
               {
                  box[j].checked=true;
               }
           }
       }
    }
    if(0 == box.length)
    {
       flag = false;
    }
    else
    {
      for(var i = 0; i < box.length; i++)
      {
         if(!box[i].checked)
         {
           flag = false;
         }          
       }
     }
     if(flag)
     {
           mybox[0].checked=true;
     }
     else
     {
           mybox[0].checked=false;
      }  
  }
</SCRIPT>
<META content="MSHTML 6.00.2900.3243" name=GENERATOR>
</HEAD>
<BODY onload="init();">
<TABLE width="100%" height="100%" border=0 cellPadding=0 cellSpacing=0>
	<TBODY>
		<TR>
			<TD bgcolor="#FFFFFF" class=right_bg>
			<table width="100%" height="5" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td></td>
				</tr>
			</table>
			<table width="100%" border="0" align="center" cellpadding="0"
				cellspacing="0">
				<tr>
					<td width="20">&nbsp;</td>
					<td class="text_12_title">当前位置: <a href="#" class="blue_1">首页</a>
					&gt; <a href="#" class="blue_1">岗位管理</a>&gt; 查询角色信息</td>
				</tr>
			</table>
			<table width="100%" height="10" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td></td>
				</tr>
			</table>
			<table width="98%" border="0" cellpadding="0" cellspacing="0"
				background="../images/bg_body_title.jpg" class="list_border1">
				<tr>
					<td width="10">&nbsp;</td>
					<td>
					<table border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td></td>
							<td valign="bottom" class="text_12_border">查询角色信息</td>
							<td></td>
						</tr>
					</table>
					</td>
				</tr>
			</table>
			<table width="98%" border="0" cellpadding="0" cellspacing="0"
				class="list_border2">
				<tr>
					<td align="center" valign="top">
					<table width="98%" height="20" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td></td>
						</tr>
					</table>

					<table width="98%" border="0" cellspacing="0" cellpadding="0">
						<form name="myform" method="POST"
							action="../station/queryRoleInfo.html">
						<tr>
							<td width="20">&nbsp;</td>
							<td width="60">角色名称：</td>
							<td width="100"><input type="text" name="roleName"
								id="roleName"></td>
							<td width="20">&nbsp;</td>
							<td><input name="Submit" type="submit" class="button_normal"
								value="查  询"></td>
						</tr>
						</form>
					</table>

					<table width="98%" height="10" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td></td>
						</tr>
					</table>
					<TABLE width="98%" border=0 cellPadding=0 cellSpacing=0
						class=list_border>
						<TBODY>
							<TR>
								<TD class=list_title width="2"><IMG height=20
									src="../images/icon_line2.gif" width=2></TD>
								<TD width=10% class=list_title><input type="checkbox"
									name="mybox" onclick="allCheckBox(mybox);"></TD>
								<TD class=list_title width="2"><IMG height=20
									src="../images/icon_line2.gif" width=2></TD>
								<TD width="20%" class=list_title>角色名称</TD>
								<TD width="1" class=list_title><IMG height=20
									src="../images/icon_line2.gif" width=2></TD>
								<TD width="20%" class=list_title>子系统名称</TD>
								<TD width="2" class=list_title><IMG height=20
									src="../images/icon_line2.gif" width=2></TD>
								<TD width="20%" class=list_title>角色描述</TD>
							</TR>
							<c:forEach var="bean" items="${roleBean}" varStatus="status">
								<c:choose>
									<c:when test="${status.index%2==0}">
										<TR class=list_td_white1>
									</c:when>
									<c:when test="${status.index%2==1}">
										<TR class=list_td_white0>
									</c:when>
								</c:choose>
								<TD></TD>
								<TD align="center"><input type="checkbox" name="checkbox2"
									value="${bean.roleId},${bean.roleName}"
									onclick="cancelMyBox(this);"></TD>
								<TD></TD>
								<TD align="center">${bean.roleName}</TD>
								<TD></TD>
								<TD align="center">${bean.systemName}</TD>
								<TD></TD>
								<TD align="center">${bean.roleDesc}</TD>
								<TD></TD>
								</TR>
							</c:forEach>
						</TBODY>
					</TABLE>
					<table width="98%" height="24" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td align="right"><iss:navigation /></td>
						</tr>
					</table>
					<table width="98%" height="28" border="0" cellpadding="0"
						cellspacing="0">
						<tr>

							<td valign="top"><input name="Submit22" type="button"
								class="button_normal" value="确  认" onClick="chooseRole();">
							&nbsp;&nbsp; </td>
						</tr>
					</table>
			</table>
			<table width="98%" height="5" border="0" cellpadding="0"
				cellspacing="0">
				<tr>
					<td></td>
				</tr>
			</table>
			</TD>
		</TR>
	</TBODY>
</TABLE>
</BODY>
</HTML>
